#ifndef __BSP_BOOTLOADER_H
#define __BSP_BOOTLOADER_H
#include "LPC17xx.h"
#define	IMG_START_PAGE	5	/* 起始扇区号 */
#define	IMG_START_SECTOR	0x00005000	/* Sector 16 应用程序地址 */
#define	IMG_END_PAGE	21	/* 起始扇区号 */
#define	IMG_END_SECTOR		0x00040000	/* Sector 21 */

#define	update_app 21
#define	update_iap 22

extern uint32_t received_data;
extern uint8_t read_buf[4096];
uint32_t load_image(uint8_t *data, uint16_t length);
void Boot( void );

uint8_t iap_write_update_flag(uint8_t value);
void get_info(void);
void erase_fun(uint32_t start_page,uint32_t end_page);
void update(void);
#endif
